package com.cuckoo.util;


import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.PropertyResourceBundle;
import java.util.ResourceBundle;


@Slf4j
@Data
@Component
public class Config {

    public static String SALT;

    static {
        //初始化
        getInsatnce ();

    }
    private static Config instance = new Config();
    public static Config getInsatnce(){
        return instance;
    }



    private Config(){
        log.info("Config instance create");
        ResourceBundle resourceBoudle = null;

        try {
            resourceBoudle = new PropertyResourceBundle(
                    getClass()
                            .getClassLoader()
                            .getResourceAsStream(
                                    "deploy.properties"));
            this.SALT=resourceBoudle.getString("salt");
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

}
